package com.rmxx.fruit.activity;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.company.android.fruit.R;
import com.kwan.xframe.mvp.presenter.BasePresenter;
import com.kwan.xframe.mvp.view.activity.BaseCommonRecycleActivity;
import com.rmxx.fruit.bean.Order;

import java.util.ArrayList;
import java.util.List;

public class OrderActivity extends BaseCommonRecycleActivity {

	List<Order> mOrders = new ArrayList<>();

	@Override
	protected BasePresenter getBasePresenter() {
		return null;
	}

	@Override
	protected RecyclerView.ItemDecoration getItemDecoration() {
		return null;
	}

	BaseQuickAdapter<Order, BaseViewHolder> mAdapter;

	@Override
	protected BaseQuickAdapter getAdapter() {


		mOrders.add(new Order());
//		mOrders.add(new Order());
//		mOrders.add(new Order());

		mAdapter = new BaseQuickAdapter<Order, BaseViewHolder>(R.layout.list_item_order_detail, mOrders) {
			@Override
			protected void convert(BaseViewHolder helper, Order item) {

			}
		};
		mAdapter.addFooterView(getLayoutInflater().inflate(R.layout.layout_order_amount, null));

		return mAdapter;
	}

	@Override
	protected void initViewSetting() {
		super.initViewSetting();

		findViewById(R.id.tv_confirm).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				go2Activity(OrderConfirmActivity.class, null, false);
			}
		});

		findViewById(R.id.v_back).setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				finish();
			}
		});

		refreshLayout.setEnableRefresh(false);
		refreshLayout.setEnableLoadMore(false);
	}

	@Override
	protected RecyclerView.LayoutManager getLayoutManager() {
		return new LinearLayoutManager(this);
	}

	@Override
	protected String getTitleTxt() {
		return null;
	}

	@Override
	public String getPageName() {
		return null;
	}

	@Override
	protected int getTopViewId() {
		return R.layout.layout_order_title;
	}

	@Override
	protected int getBottomViewId() {
		return R.layout.layout_order_bottom;
	}

	@Override
	protected void initData() {

	}
}
